function t(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}

var e = t(require("../../utils/api2")), n = t(require("../../public/utils/event-emitter")), s = n.default.emit, i = n.default.addListener, o = {
    data: null,
    pull: function() {
        var t = this;
        e.default.site.message.notifylists().then(function(e) {
            e.isfollow;
            var n = e.lists;
            t.data = n.map(function(t) {
                return t.type = "normal", t.contents = [], t.content.split(t.name).forEach(function(e) {
                    t.contents.push(e, t.name);
                }), t.contents.pop(), t;
            });
        }).then(function() {
            return s("sync.notices");
        });
    }
};

Component({
    data: {
        show: !1,
        notices: []
    },
    ready: function() {
        var t = this;
        i("sync.notices", function() {
            var e = o.data;
            e ? t.setData({
                show: !(!e || !e[0]),
                notices: e
            }) : o.pull();
        }), s("sync.notices");
        var e = getCurrentPages(), n = e[e.length - 1], a = n.onPullDownRefresh;
        n.onPullDownRefresh = function() {
            o.pull(), a();
        };
    },
    methods: {
        closeNotice: function() {
            var t = o.data.shift().mid;
            t && e.default.site.message.view({
                data: {
                    mid: t
                }
            }), s("sync.notices");
        }
    }
});